package com.lggry.javabean;

public class StudentOperator {
    //必须拿到要处理的学生对象
    private Student s;  //用于记录将来要操作的对象
    public StudentOperator(Student s){
        this.s = s;
    }

    public void printTotal(){
        System.out.println(s.getName()+"同学的总成绩为："+(s.getChinese()+s.getEnglish()+s.getMath()));
    }

    public void printAvg(){
        System.out.println(s.getName()+"同学的平均成绩为："+(s.getChinese()+s.getEnglish()+s.getMath())/3);
    }
}
